﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VINETLIFE.BL;

namespace VINETLIFE.Module
{
    public partial class ucVnVinetlifeNews : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rptHomeNewsDataSource();
            }
        }

        private void rptHomeNewsDataSource()
        {
            rptHomeNews.DataSource = new cmsArticleBL().SelectByCategoryAndNumber(31,15);
            rptHomeNews.DataBind();
        }
        protected string FriendlyUrl(string s)
        {
            return Ultility.Change_AV(s);
        }
        public string WordCut(string text)
        {
            return Ultility.WordCut(text, 100, new char[] { ' ', '.', ',', ';' }) + "...";
        }
    }
}